//
//  YBCodeTagCell.m
//  Cocoachina
//
//  Created by 游兵 on 2017/9/15.
//  Copyright © 2017年 YBing. All rights reserved.
//

#import "YBCodeTagCell.h"

@implementation YBCodeTagCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self=[super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        UIView *selectedBackgroundView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenW, 44)];
        selectedBackgroundView.backgroundColor = kNavColor;
        self.selectedBackgroundView = selectedBackgroundView;
        self.detailTextLabel.textColor = [UIColor grayColor];
        self.textLabel.font = [UIFont systemFontOfSize:14];
        self.detailTextLabel.font = [UIFont systemFontOfSize:14];
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    if (selected) {
        self.textLabel.textColor = [UIColor whiteColor];
        self.detailTextLabel.textColor = [UIColor whiteColor];
    } else {
        self.textLabel.textColor = [UIColor blackColor];
        self.detailTextLabel.textColor = [UIColor grayColor];
    }
}

- (void)setCodeTag:(YBCodeTag *)codeTag
{
    _codeTag = codeTag;
    self.textLabel.text = [NSString stringWithFormat:@"%@%@", codeTag.zh, codeTag.en];
    self.detailTextLabel.text = codeTag.num;
}

@end
